public class DuoTaiDemo07 {
    public static void main(String[] args) {
//        play(new Bird());
//        play1(new Bee());
        play(new Bee());
    }

    public static void play(FlyClass flyClass) {
        flyClass.fly("跟着我");
    }

//    public static void play(Bird bird) {
//        bird.fly("跟着我");
//    }

//    public static void play1(Bee bee) {
//        bee.fly("跟着我");
//    }
}


class FlyClass {

    public void fly(String content) {
        System.out.println("飞");
    }

}

class Bird extends FlyClass {
    @Override
    public void fly(String content) {
        System.out.println(content + "吱吱的飞");
    }
}

class Bee extends FlyClass {

    @Override
    public void fly(String content) {
        System.out.println(content + "嗡嗡的飞");
    }
}